XMLElement xml;
String[] t_tag;
int[] t_count;
int v_convertit;

PFont myFont1;
PFont myFont2;



void setup() {

  size(300, 300);

  xml = new XMLElement(this, "../tagmehdi.xml"); // appel du fichier XML
  int v_nbrPost = xml.getChildCount();
  t_tag = new String[0];
  t_count = new int[0];

  for (int i = 0; i < v_nbrPost; i++) {
    XMLElement v_post     = xml.getChild(i); // Initialise un objet v_post qui correspond au i-eme enfant du noeud XML

    v_convertit =  int(v_post.getStringAttribute("count"));
    if(v_convertit > 7){
      t_tag = append(t_tag,v_post.getStringAttribute("tag"));
      t_count = append(t_count,v_convertit);
    } 
  }


  
  myFont1 = createFont("AGaramondPro-Regular", 32);
  myFont2 = createFont("AGaramondPro-Regular", 100);
  
  
//  typo = loadFont("data/AGaramond-Regular-100.vlw");


  /*   ___________________ Print de test ___
   /____________________________________/
   */

  for (int i=0 ; i < t_tag.length; i++){
    println(t_tag[i]);
    println(t_count[i]);
    println("=================");
  }

  noLoop();
}


void draw() {
  // Use fill() to change the value or color of the text

  textFont(myFont1);
  text(t_tag[0], 0, 60);

  textFont(myFont2);
  text(t_tag[1], 70, 150);
}


